package bill.java.interview.unknown;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

public class DependencyByLevel {
	
	
	private Map<String, Integer> levelMap = new HashMap<String, Integer>();
	
	public void setValue(String columnName, int value){
		
	}
	
	public void setDependentValues(String columnName, int value){
		
		if(columnName == null){
			throw new NullPointerException("columnName cannot be null.");
		}
		
		
		if(!isSet(columnName)){
			setValue(columnName, value);
		}
		
		for(String dependent: getDependents(columnName)){
			if(!isSet(dependent)){
				setValue(dependent, value + 1);
			}
		}
	}
	
	private Collection<String> getDependents(String column){
		return null;
	}
	
	private boolean isSet(String columnName){
		Integer val =levelMap.get(columnName);
		if(val == null){
			return false;
		}
		return true;
	}

}
